#include "BoidCollisionEvent.h"
#include "Boid.h"

bool BoidCollisionEvent::Collide(DynamicSphere *s1, DynamicSphere *s2)
{
	Boid *b1 = (Boid*)s1;
	Boid *b2 = (Boid*)s2;

	if(b1->Type() == Boid::BoidType::Red)
	{	
		if(b2->Type() == Boid::BoidType::Yellow)
		{
			b1->SetEnergy(b1->Energy() + Boid::YellowEnergy());
			eatenBoids.push_back(s2);
			return false;
		}
	}
	else if(b2->Type() == Boid::BoidType::Red)
	{
		b2->SetEnergy(b2->Energy() + Boid::YellowEnergy());
		eatenBoids.push_back(s1);
		return false;
	}
	return true;
}

list<DynamicSphere*>* BoidCollisionEvent::EatenBoids(void)
{
	return &eatenBoids;
}